﻿using System;
using DosTexPrj.Core.Models;
using FluentNHibernate.Mapping;

namespace DosTexPrj.Implement.NHibernate.Mapping
{
    public class DyeOrderDetailMapping : ClassMap<DyeOrderDetail>
    {
        public DyeOrderDetailMapping()
        {
            Table("DyeOrderDetails");
            Id(x => x.Id, "DyeOrderDetailID").UnsavedValue(Guid.Empty).GeneratedBy.Guid();
            References<DyeOrder>(x => x.BelongToDyeOrder).Column("DyeOrderID").Not.LazyLoad();
            Map(x => x.Length).Not.Nullable();
            Map(x => x.Weight).Not.Nullable();
            Map(x => x.IsCompact).Default("0");
            Map(x => x.IsCuttingGomming).Default("0");
            Map(x => x.IsEnzim).Default("0");
            Map(x => x.IsResine).Default("0");
            Map(x => x.IsRolling).Default("0");
            Map(x => x.IsSilicon).Default("0");
            Map(x => x.SpecialFinishing).Length(200);
        }
    }
}